#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main()
{
	int k = 0;
	int arr[123] = { 0 };
	string str1;
	cin >> str1;
	for (int i = 0; i < str1.size(); i++) {
		int j = (int)str1[i];
		arr[j]++;
	}
	for (int i = 65; i <= 90; i++) {
		if (arr[i] && arr[i + 32]) {
			k++;
		}
	}
	cout << k;
	return 0;
}
//a 97;	 z 122;  A 65;  Z 90